Safe Parallel Programming with Session Java
نویسندگان
چکیده
The session-typed programming language Session Java (SJ) has proved to be an effective tool for distributed programming, promoting structured programming for communications and compile-time safety. This paper investigates the use of SJ for session-typed parallel programming, and introduces new language primitives for chained iteration and multi-channel communication. These primitives allow the efficient coordination of parallel computation across multiple processes, thus enabling SJ to express the complex communication topologies often used by parallel algorithms. We demonstrate that the new primitives yield clearer and safer code for pipeline, ring and mesh topologies through implementations of representative parallel algorithms. We then present a semantics and session typing system including the new primitives, and prove type soundness and deadlock-freedom for our implementations. The benchmark results show that the new SJ is substantially faster than the original SJ and performs competitively against MPJ Express1 used as reference.
منابع مشابه
Session-Based Programming for Parallel Algorithms: Expressiveness and Performance
This paper investigates session programming and typing of benchmark examples to compare productivity, safety and performance with other communications programming languages. Parallel algorithms are used to examine the above aspects due to their extensive use of message passing for interaction, and their increasing prominence in algorithmic research with the rising availability of hardware resou...
متن کاملType-Safe Eventful Sessions in Java
Event-driven programming is a widely accepted approach to building robust, scalable servers. However, it forces application programmers to manually maintain clientspecific state, leading to unsafe programs with obfuscated control flows. This paper introduces a Java language extension and its type system for structured event-driven programming, based on session types. Built on a simple extension...
متن کاملType-safe Communication in Java with Session Types
This paper demonstrates the impact of integrating session types for communication behaviour into object-oriented languages, through their implementation in a distributed Java. Session types abstract a potentially unbounded structured sequence of communications in an easy-to-read type syntax, and guarantee the absence of communication errors through static type-checking. The introduction of sess...
متن کاملSession-Based Distributed Programming in Java
This paper demonstrates the impact of integrating session types and object-oriented programming, through their implementation in Java. Session types provide high-level abstraction for structuring a series of interactions in a concise syntax, and ensure type-safe communications between distributed peers. We present the first full implementation of a language and runtime for session-based distrib...
متن کاملThe SJ Framework for Transport-Independent, Type-Safe, Object-Oriented Communications Programming
Communications programming, involving complex message exchanges over multiple transports, is an omnipresent element in modern distributed applications. Existing engineering solutions however have considerable limitations: there is no portability across differing transports. Programming abstractions for communication are typically provided through low-level APIs, bound to specific transports or ...
متن کامل